/* eslint-disable*/
import React from 'react';
import { Modal } from 'antd';
import './index.less';
import Title from '../FormItem/Title';

export default (data: any) => {
  const {
    title,
    width = 352,
    visible = false,
    okText = '确定',
    cancelText = '取消',
    children,
    height = 800,
    ...otherProps
  } = data;
  return (
    <Modal
      title={typeof title === 'string' ? <Title text={title} /> : title}
      visible={visible}
      okText={okText}
      cancelText={cancelText}
      width={width}
      // closable={false}
      destroyOnClose={true}
      wrapClassName={'X-Modal'}
      {...otherProps}
    >
      {children}
    </Modal>
  );
};